
function checkForValidUrl(tabId, changeInfo, tab) {
  if (tab.url.indexOf('z8games.com/') > -1) {
    chrome.pageAction.show(tabId);
  }
};

chrome.tabs.onUpdated.addListener(checkForValidUrl);


chrome.pageAction.onClicked.addListener(function(tab) {
  chrome.tabs.executeScript(null, {file: "options.js"});
});

chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
    if (request.method == "getLocalStorage") {
		sendResponse({status: localStorage[request.key]});
	} else
		sendResponse({});
});